import Vue from 'vue'
import VueRouter from 'vue-router'
import home from "@/views/home/Home";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'icePeachHome',
    component: () => import(/* webpackChunkName: "about" */ '../views/icepeachhome/IcePeachHome.vue'),
    children: [
      {
        path: '/',
        name: 'homePage',
        component: () => import(/* webpackChunkName: "about" */ '../views/icepeachhome/homePage.vue')

      },
      {
        path: '/SingleArticle/:title',
        name: 'SingleArticle',
        component: () => import(/* webpackChunkName: "about" */ '../views/icepeachhome/SingleArticle.vue')

      },
      ]
  },
  {
    path: '/home',
    name: 'home',
    component: home,
    children: [
      {
        path: '/',
        name: 'user',
        component: () => import(/* webpackChunkName: "about" */ '../views/user/UserList.vue')

      },
      {
        path: 'category',
        name: 'category',
        component: () => import(/* webpackChunkName: "about" */ '../views/category/category.vue')

      },
      {
        path: 'article',
        name: 'article',
        component: () => import(/* webpackChunkName: "about" */ '../views/article/article.vue')

      },
      {
        path: 'role',
        name: 'role',
        component: () => import(/* webpackChunkName: "about" */ '../views/role/role.vue')

      },
      {
        path: 'menu',
        name: 'menu',
        component: () => import(/* webpackChunkName: "about" */ '../views/menu/menu.vue')

      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "about" */ '../views/login/login')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import(/* webpackChunkName: "about" */ '../views/register/register')
  },


]

const router = new VueRouter({
  routes
})

export default router
